package org.wukl.vhr.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.wukl.vhr.mapper.DepartmentMapper;
import org.wukl.vhr.model.Department;

import java.util.List;

@Service
public class DepartmentService {
    @Autowired
    DepartmentMapper departmentMapper;
    public List<Department> queryAllDepartment()
    {
        return departmentMapper.queryAllDepartmentByParentId(-1);
    }
    public void addDepartment(Department dept)
    {
        departmentMapper.addDepartment(dept);

    }
    public Department selectDepartmentById(Integer id)
    {
        return departmentMapper.selectByPrimaryKey(id);
    }
    public void deleteDepartment(Department depart)
    {
        departmentMapper.deleteDepartment(depart);
    }
}
